import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2022-11-25
 * Time: 13:23
 */

class Animal {
    public String name;
    public int age;

    static {
        System.out.println("Animal static{}");
    }

    {
        System.out.println("Animal {}");
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal 带有两个参数的构造方法");
    }
    public Animal(){
        System.out.println("Animal 不带参数的构造方法");
    }

    public void eat() {
        System.out.println(name + "正在吃饭");
    }
}

 class Dog extends Animal{
    static {
        System.out.println("Dog static{}");
    }

    {
        System.out.println("Dog {}");
    }

    public Dog() {
        System.out.println("Dog 不带参数的构造函数");
    }

    public void wangwang() {
        System.out.println(name + "正在叫");
    }
}

public class Test {

}
